package com.ninong.ker.common.exception;

import static org.springframework.http.HttpStatus.BAD_REQUEST;

import com.ninong.ker.common.tools.enums.BusinessEnum;

import lombok.Getter;

/**
 * @author cmd
 * @date 2020-11-23 统一异常处理
 */
@Getter
public class CmdException extends RuntimeException{

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer status = BAD_REQUEST.value();

    public CmdException(String msg){
        super(msg);
    }

    public CmdException(Integer status,String msg){
        super(msg);
        this.status = status;
    }
    public CmdException(BusinessEnum bus){
    	super(bus.getMsg());
    	this.status = bus.getStatus();
    }
}
